<include file="Common:header" />
<TYimport plugin='datepicker' />
<div class="table_content" >
    <form enctype="multipart/form-data" id="upForm" class="ajax_form">
        <table class="edit_table">
            <tr>
                <td class="tablehead">用戶名：</td>
                <td>
                    w_admin<label class="tips"></label>
                </td>
            </tr>
             <tr>
                <td class="tablehead">原密码：</td>
                <td>
                    <input type="text" name="old_pwd" class="text w150 required"/><label class="tips"></label>
                </td>
            </tr>
            <tr class="server_tel">
                <td class="tablehead">新密码：</td>
                <td>
                    <input type="text" name="new_pwd" class="text w150 required"/><label class="tips"></label>
                </td>
            </tr>
			<tr class="server_tel">
                <td class="tablehead">确认新密码：</td>
                <td>
                    <input type="text" name="confirm_new_pwd" class="text w150 required"/><label class="tips"></label>
                </td>
            </tr>
            <tr>
                <td class="tablehead">操作</td>
                <td>
                	<input type="button" class="save_btn" value="保存"/>
                    <input type="button" class="back_btn" value="返回"/>
                </td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">

$('.save_btn').click(function(){
	if($('input[name=old_pwd]').val() == ''){
		callBackTips(0,'請輸入原密碼');return false;
	}
	if($('input[name=new_pwd]').val() == '' && $('input[name=new_pwd]').val() == ''){
		callBackTips(0,'新密碼不能為空');return false;
	}
	var formData = new FormData($( "#upForm" )[0]);   
    $.ajax({    
         url: "{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/admin_password_change')}" ,
         type: 'POST',    
         data : formData,    
         async: false,    
         cache: false,    
         contentType: false,    
         processData: false,    
         success: function (returndata) {    
        	if(returndata.status){
        		 callBackTips(returndata.status,returndata.info,returndata.status);
     		}else{
     			callBackTips(0,returndata.info);
     		}
         },    
    });    
});
</script>
<include file="Common:footer" />
